<template>
  <el-menu
    default-active="2"
    class="el-menu-vertical-demo"
    @open="handleOpen"
    @close="handleClose"
    background-color="#353268"
    text-color="#f3f3f3"
    active-text-color="#ffd04b"
    router
  >
    <el-menu-item index="/index">
      <i class="el-icon-s-home"></i>
      <span slot="title">首&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;页</span>
    </el-menu-item>
    <el-submenu index="">
      <template slot="title">
        <i class="el-icon-notebook-1"></i>
        <span class="title-span">文章管理</span>
      </template>
      <el-menu-item-group>
        <el-menu-item index="/article/list"
          ><i class="el-icon-tickets"></i
          ><span slot="title">文章列表</span></el-menu-item
        >
        <el-menu-item index="/article/add"
          ><i class="el-icon-document-add"></i
          ><span slot="title">添加文章</span></el-menu-item
        >
      </el-menu-item-group>
    </el-submenu>
    <el-menu-item index="/picture">
      <i class="el-icon-picture-outline"></i>
      <span slot="title">图片管理</span>
    </el-menu-item>
    <el-menu-item index="/user">
      <i class="el-icon-user"></i>
      <span slot="title">用户管理</span>
    </el-menu-item>
    <el-menu-item index="/platform">
      <i class="el-icon-s-platform"></i>
      <span slot="title">终端管理</span>
    </el-menu-item>
  </el-menu>
</template>

<script>
export default {
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
};
</script>

<style scoped>
.el-menu {
  border: none;
}
.el-menu-item,.el-menu{
  text-align: left;
}
.el-menu-item i,
.el-submenu__title i {
  margin-left: 10px;
  margin-right: 10px;
  color: #f3f3f3 !important;
}
</style>
